-
Notifications
You must be signed in to change notification settings - Fork 604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When prefixing with a data, eagerly get local name #1614
Conversation
Fixes #1606 Previously, the Data itself would be put on the prefix stack and its full name would be used as the prefix for subsequent names. This meant that prefixes would grow quadratically as the prefix is present both on the Data pushed to the stack, and on the stack itself. This is fixed by just using the "local" name of the Data being pushed on the stack. A related issue is deferring the name resolution. This led to unintuitive behavior when the name of a Data used as a prefix is overridden later (usually when the Data is a return value). The overriding name would show up in prefixes twice instead of once. It is much more intuitive to grab the name at the moment of the connection creating the prefix rather than deferring to later.
This is Draft for now because I want to try it out and see how well it works despite the linear lookup for names of aggregate children. I have an idea to fix it, but as mentioned it might violate bad assumptions so need to be careful. I also want to change the prefix stack to be a |
I think separate PRs is good. Let's merge this ASAP. |
Alright, do you think I should do https://github.com/freechipsproject/chisel3/pull/1614/files#diff-61c46b849f372e39e0c29dc7945edcbbR374 or if performance looks okay do that in follow on as well? |
Let's do a follow-on PR. |
@Mergifyio refresh |
Command
|
Fixes #1606 Previously, the Data itself would be put on the prefix stack and its full name would be used as the prefix for subsequent names. This meant that prefixes would grow quadratically as the prefix is present both on the Data pushed to the stack, and on the stack itself. This is fixed by just using the "local" name of the Data being pushed on the stack. A related issue is deferring the name resolution. This led to unintuitive behavior when the name of a Data used as a prefix is overridden later (usually when the Data is a return value). The overriding name would show up in prefixes twice instead of once. It is much more intuitive to grab the name at the moment of the connection creating the prefix rather than deferring to later. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit 1b15dca)
* When prefixing with a data, eagly get local name (#1614) Fixes #1606 Previously, the Data itself would be put on the prefix stack and its full name would be used as the prefix for subsequent names. This meant that prefixes would grow quadratically as the prefix is present both on the Data pushed to the stack, and on the stack itself. This is fixed by just using the "local" name of the Data being pushed on the stack. A related issue is deferring the name resolution. This led to unintuitive behavior when the name of a Data used as a prefix is overridden later (usually when the Data is a return value). The overriding name would show up in prefixes twice instead of once. It is much more intuitive to grab the name at the moment of the connection creating the prefix rather than deferring to later. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit 1b15dca) * Waive MiMa failures on package private methods Co-authored-by: Jack Koenig <koenig@sifive.com>
Fixes #1606
Previously, the Data itself would be put on the prefix stack and its
full name would be used as the prefix for subsequent names. This meant
that prefixes would grow quadratically as the prefix is present both on
the Data pushed to the stack, and on the stack itself. This is fixed by
just using the "local" name of the Data being pushed on the stack.
A related issue is deferring the name resolution. This led to unintuitive
behavior when the name of a Data used as a prefix is overridden later
(usually when the Data is a return value). The overriding name would
show up in prefixes twice instead of once. It is much more intuitive to
grab the name at the moment of the connection creating the prefix rather
than deferring to later.
TODO
Fix linear lookup of aggregate children - proposal is to force the local names of aggregate children, this could violate weird assumptions so need to be carefulLaterSwitch implementation of prefix stack to List[String] - this will improve memory and performance a decent amountLaterContributor Checklist
docs/src
?Type of Improvement
API Impact
No impact on API (changing types of methods on a package private object will require MiMa waivers but isn't visible to the user).
Backend Code Generation Impact
Improves names from recursive functions where prefixing occurs due to a connection quite a bit
Desired Merge Strategy
Release Notes
Fix quadratic naming in recursive functions (Fixes #1606)
Reviewer Checklist (only modified by reviewer)
Please Merge
?